
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<heard>

</heard>
<script type="text/javascript">

	$(function(){
		$(".chosen-select").chosen({});
		var deductCode ='${items.deductCode}'
		//*******************数字校验*********************************
		$("#amount").decimalinput();
	
		//*****************************************************
 	/* $("#deductCode").FillOptions(Com_Parameter.ContextPath+"/sys/base/article/getArticle",{datatype:"json",textfield:"articleName",valuefiled:"article",defValue:"${items.deductCode}"}); */
		if(deductCode!=null){
			var shopId=$("#storeId").val();
			$("#taxRateCode_items").FillOptions(Com_Parameter.ContextPath+"/sys/base/article/getSysBaseRateCode?itemNum="+deductCode+"&shopId="+shopId,{datatype:"json",textfield:"articleName",valuefiled:"article",defValue:"${items.taxRateCode}"});
		}	
		
	});
	function chenageDeductCode(t,text,value){
		$("#deductItem").val(text.split('-')[0]);  
		var shopId=$("#storeId").val();
		$("#taxRateCode_items").FillOptions(Com_Parameter.ContextPath+"/sys/base/article/getSysBaseRateCode?itemNum="+value+"&shopId="+shopId,{datatype:"json",textfield:"articleName",valuefiled:"article",defValue:"${items.taxRateCode}"});
	}
	
	function taxRateChange(t,text){
		$("#taxRate_items").val(text);  
	}
</script>
<div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                 <h4 class="modal-title">合同条款添加</h4>
            </div>			<!-- /modal-header -->
            <div class="modal-body">
            <table class="table">  
            	<tr>
            		<td  >
  	 					<div class="col-sm-12">
							    <label for="deductCode_lab" class="col-sm-5 control-label">扣款项代码:</label>
									<div  class="input-group col-sm-7">
									<ossp:select chosen="chosen"  style="width:170px;"  class_="chosen-select" id="deductCode" defaultSelected="${items.deductCode}"
									 onchange="chenageDeductCode(this,this.options[this.options.selectedIndex].text,this.options[this.options.selectedIndex].value)" 
									  service="selectArtictService?contractType=${contractType}&superOption=${supplierOption}"></ossp:select>
										<input type="hidden"  id="operate_item" value="${operate}"/>
										<input type="hidden"  id="item_seq" value="${num}"/>
										<input hidden="hidden" id="deductCate">
								</div>
						 </div>
						
					</td>
						<td >
	  	 					<div class="col-sm-12">
								    <label for="deductItem_lab" class="col-sm-5 control-label">扣款项:</label>
									<div class="  col-sm-7">
											<input  id="deductItem" readonly="readonly" value="${items.deductItem}"  class="form-control"/>
									</div>
							  	</div>
						</td>
					
				</tr>
				
				<tr>
					<td  >
  	 					<div>
							<label for="startDate_lab" class="col-sm-5 control-label">开始日期:</label>
								<div class=" col-sm-7">
									 		<div class="input-group date startDate " data-date="" data-date-format="yyyy-mm-dd" >
										          <input class="form-control" value="<fmt:formatDate value="${items.startDate}" type="both" pattern="yyyy-MM-dd"/>" id="startDate_items" name="startDate_items" disabled="disabled"    size="10"  data-rule="required" type="text" />
							                   	 <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
						                	</div>
								</div>
						  	</div>
						  	
					</td>
					<td  >
  	 					<div>
							    <label for="endDate_lab" class="col-sm-5 control-label">结束日期:</label>
								<div class=" col-sm-7">
									<div class="input-group date endDate " data-date="" data-date-format="yyyy-mm-dd" >
										          <input class="form-control" id="endDate_items"  value="<fmt:formatDate value="${items.endDate}" type="both" pattern="yyyy-MM-dd"/>" name="endDate_items" disabled="disabled"    size="10"  data-rule="required" type="text" />
							                   	 <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
						                	</div>
								</div>
						  	</div>
					</td>
				</tr>
				
				<tr>
            			<td  >
  	 					<div class="col-sm-12">
							    <label for="amount_lab" class="col-sm-5 control-label">金额/比例:</label>
								<div class=" col-sm-7">
										<input type="text" id="amount" value="<fmt:formatNumber value="${items.amount}" pattern="#.00#"/>" class="form-control">
										
								</div>
						  	</div>
					</td>
					<td  >
  	 					<div class="col-sm-12">
							    <label for="validType_lab" class="col-sm-5 control-label">时效类型:</label>
								<div class=" col-sm-7">
										<ossp:select defaultSelected="${items.validType}" class_="f_5" id="validType_items"  dictType="DEFEND_SYTLE"></ossp:select>
								</div>
						</div>
				
					</td>
				</tr>
				
				<tr>
	            		<td  >
	  	 					<div class="col-sm-12">
								    <label for="deductType_lab" class="col-sm-5 control-label">扣款方式 :</label>
									<div class="  col-sm-7 ">
											<ossp:select defaultSelected="${items.deductType}" class_="f_5" id="deductType"  dictType="PAYMENT_TYPE"></ossp:select>		
											
									</div>
							  	</div>
						</td>
						<td>
						<div class="col-sm-12">
							    <label for="countBase_lab" class="col-sm-5 control-label">计算基数:</label>
								<div class=" col-sm-7">
										<ossp:select defaultSelected="${items.countBase}" class_="f_5" id="countBase"  dictType="COMPUTE_BASE"></ossp:select>		
								</div>
						</div>
						
						</td>
				 </tr>
				 
				 <tr>
	            		<td  colspan="2">
	  	 					<div class="col-sm-12">
								    <label for="taxRate_lab" class="col-sm-2 control-label">税率:</label>
									<div class=" col-sm-7">
											<select onchange="taxRateChange(this,this.options[this.options.selectedIndex].text)" id="taxRateCode_items" class="form-control"> </select>
											<input type="hidden" id="taxRate_items">
										
											
									</div>
							  	</div>
						</td>
						
				 </tr>
 	 		
				 <tr>
	            		<td   colspan="2">
	  	 					<div class="col-sm-12 form-group">
								    <label for="remarks_lab" class="col-sm-2 control-label">备注  :</label>
									<div class=" col-sm-7">
									<textarea style="width: 100" id="remarks_items" cols="6"   class="form-control">
									${items.remarks}
									</textarea>
									</div>
							  	</div>
						</td>
					
				 </tr> 
				 	<!-- <tr>
						
						<td colspan="2">
						<div class="col-sm-12 form-group ">
							<label for="element5" class="col-sm-2 control-label">单项选择:</label>
							<div class="col-sm-10">
						         <select data-o-chosen="chosen" data-placeholder="选择一个国家" class="chosen-select" style="width:200px;">
						            <option value=""></option>
						            <option value="01">中国</option>
						            <option value="02">美国</option>
						            <option value="03">俄罗斯</option>
						            <option value="04">德国</option>
						            <option value="05">英国</option>
						            <option value="06">法国</option>
						         </select>
							</div>
						</div>
						</td>
					</tr> -->
			</table>
				
            </div>			
            <!-- /modal-body -->
            <div class="modal-footer">
                <button type="button" id="ok_items"  onclick="btnItemsOk_click()"  class="btn btn-primary" onclick="">确定</button>
                 <button type="button"  class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>			
            <!-- /modal-footer -->
        </div>         
        <!-- /modal-content -->
    </div>
    <script type="text/javascript">
	
	$('.startDate').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		setLocalDate: new Date(2011, 2, 5),
		format: 'yyyy-mm-dd'
    })
	$('.endDate').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
    })
</script>
</body>
<script type="text/javascript" src="${staticPath}/js/list.js"></script>